<?php
require('./inc/functions.php');

if (isset($_GET['action']) && $_GET['action'] == 'check_files') {
    check_files();
}


if (!is_logged(false)) {
    return_json("你还没有登录呢", 201);
}

//处理上传逻辑
if (isset($_GET['sid']) && $_GET['sid']) {
    if (!isset($_SESSION['upload_tmp']['sid']) || trim($_GET['sid']) != $_SESSION['upload_tmp']['sid']) {
        return_json("sid参数不正确", 201);
    }

    uploader($_SESSION['upload_tmp']);
    die();
}

create_sid();